{% block features_profiles_block %}
<!-- BEGIN /ionosphere/fp_veiw=true block -->
{% if list_by %}
<div class="navbar-header" role="navigation">
  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
  </button>
		<ul class="nav nav-tabs" role="view_tablist" id="view">
		  <li><a href="/ionosphere"><span class="logo"><span class="sky">Training</span> <span class="re">data</span></span></a></li>
		  <li class="active"><a href="?fp_view=true"><span class="logo"><span class="sky">Features</span> <span class="re">profiles</span></span></a></li>
		</ul>
		<div class="tab-content">
	  	<div class="tab-pane active" id="view">
{% endif %}


{% if list_by %}
	<br>
<!--  <h4><span class="logo"><span class="sky">Features</span> <span class="re">profiles</span></span></span></h4>-->
  <div class="navbar-header" role="navigation">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
<!-- # @added 20170118 - Feature #1862: Ionosphere features profiles search page -->
      <span class="icon-bar"></span>
    </button>
  </div>
{% endif %}

{% if print_debug == 'True' %}
<code> DEBUG </code> :: /ionosphere metric_files block</br>
{% endif %}


{% if print_debug == 'True' %}
<code> DEBUG </code></br>
  {% if requested_timestamp %}
<code> requested_timestamp </code>: {{ requested_timestamp }}<br>
  {% else %}
<code> requested_timestamp </code>: NOT FOUND<br>
  {% endif %}
{% endif %}

{% if display_message %}
<code> ERROR </code></br>
<code> message </code>: {{ display_message }}<br>
{% endif %}

{% if alternative_urls %}
<!-- # @added 20180420 - Branch #2270: luminosity -->
  {% for alt_url in alternative_urls %}
<a href="{{ alt_url }}">{{ alt_url }}</a><br>
  {% endfor %}
{% endif %}

{% if list_by %}
<div class="row">
	<div class="col-md-3 col-md-push-9">
		<p>Number of features profile data sets in results: <strong>{{ td_files|length }}</strong></p>
		<form action="/a_500" method="get"><b>One day</b> you may be able to
		find features profile data sets matching a pattern:<br>
			<input name="pattern" value="*">
		<input type="hidden" name="message" value="'You were told not to try and use the find feature, now look what happened.  Let that be a lesson to you to not try and break the rules.'" /></form><br>
		<div>but currently this <code>does not work</code> yet so <code>do not use</code> it<br></div>
		<div>The only reason it is here is to act as a reminder that it needs to be done.<br></div>
		<div>And perhaps inspire someone to try and add it.<br></div>
		<div><strike>If you think that you may be that person, please do get in touch.</strike><br></div>
		<div>Change in strategy: rather fork it and try and when it works, get in touch.<br></div>
	</div>
{% endif %}

{% if unique_metrics or metric_td_dirs %}
		<div class="col-md-9 col-md-pull-3">
			<ul class="nav nav-tabs" role="tablist" id="list_by-tabs">
  {% if list_by == 'date' or list_by == 'metric_td_dirs' %}
<!-- # @added 20170118 - Feature #1862: Ionosphere features profiles search page -->
			  <li><a href="/ionosphere?fp_search=true&metric=all&limit=10&order=DESC">Search</a></li>
<!-- # @added 20170917 - Feature #1996: Ionosphere - matches page -->
<!-- # @modified 20180419 - Feature #1996: Ionosphere - matches page
#                           Branch #2270: luminosity
# Return matches for the last 24 hours as the default -->
		    <li><a href="?fp_matches=true&metric=all&limit=0&from_timestamp={{ matched_from_datetime }}&order=DESC">Matches</a></li>
		    <li><a href="?fp_validate=true&metric=all">Validate</a></li>
			  <li><a href="/ionosphere?fp_view=true">List by metrics</a></li>
			  <li class="active"><a href="?fp_view=true&a_dated_list=true">List by date</a></li>
  {% elif list_by == 'metric' %}
			  <li><a href="/ionosphere?fp_search=true&metric=all&limit=10&order=DESC">Search</a></li>
		    <li><a href="?fp_matches=true&metric=all&limit=0&from_timestamp={{ matched_from_datetime }}&order=DESC">Matches</a></li>
		    <li><a href="?fp_validate=true&metric=all">Validate</a></li>
			  <li class="active"><a href="/ionosphere?fp_view=true">List by metrics</a></li>
			  <li><a href="?fp_view=true&a_dated_list=true">List by date</a></li>
		    <li><a href="?fp_validate=true&metric=all">Validate</a></li>
  {% else %}
			  <li class="active"><a href="?fp_search=true&metric=all&limit=10&order=DESC">Search</a></li>
		    <li><a href="?fp_matches=true&metric=all&limit=0&from_timestamp={{ matched_from_datetime }}&order=DESC">Matches</a></li>
		    <li><a href="?fp_validate=true&metric=all">Validate</a></li>
			  <li class="active"><a href="/ionosphere?fp_view=true">List by metrics</a></li>
			  <li><a href="?fp_view=true&a_dated_list=true">List by date</a></li>
  {% endif %}

			</ul>
			<div class="tab-content">
{% endif %}

{% if unique_metrics %}
  {% if list_by == 'metric' or list_by == 'timestamp_td_dirs' %}
<!-- BEGIN /ionosphere list_by 'metric' and 'timestamp_td_dirs' block -->
    {% if print_debug == 'True' %}
<code> DEBUG </code> :: /ionosphere list_by 'metric' and 'timestamp_td_dirs' block</br>
    {% endif %}
  	  <div class="tab-pane active" id="by_metric">
        <h4><span class="logo"><span class="sky">Metrics ::</span> <span class="re">features profiles :: </span></span> {{ td_files|length }} data sets</h4>
  			<table class="table table-hover">
  				<thead>
  					<tr>
              <th>Metric</th>
              <th>Link to features profile data sets</th>
  					</tr>
  				</thead>
  				<tbody>
    {% for metric in unique_metrics %}
            <tr>
              <td><code>{{ metric }}</code></td>
              <td onclick="window.location='?fp_view=true&metric_td={{ metric }}&requested_timestamp={{ requested_timestamp }}'">
                <a href="?fp_view=true&metric_td={{ metric }}&requested_timestamp={{ requested_timestamp }}">{{ metric }}</a>
              </td>
            </tr>
    {% endfor %}
					</tbody>
				</table>
			</div>
  {% endif %}

  {% if list_by == 'date' or list_by == 'metric_td_dirs' %}
<!-- BEGIN /ionosphere list_by 'date' and 'metric_td_dirs' block -->
    {% if print_debug == 'True' %}
<code> DEBUG </code> :: /ionosphere list_by 'date' and 'metric_td_dirs' block</br>
    {% endif %}
      <div class="tab-pane active" id="by_date">
        <h4><span class="logo"><span class="sky">Timestamps ::</span> <span class="re">features profiles :: </span></span> {{ td_files|length }} data sets</h4>
		    <table class="table table-hover">
  			<thead>
  				<tr>
            <th>Date</th>
            <th>Timestamp</th>
            <th>Link to features profile data sets</th>
  				</tr>
  			</thead>
  			<tbody>
    {% for unique_ts,hdates in metric_td_dirs %}
          <tr>
      {% if unique_ts == requested_timestamp %}
            <td><code>{{ hdates }}</code></td>
            <td> {{ unique_ts }} </td>
            <td onclick="window.location='?fp_view=true&timestamp_td={{ unique_ts }}&requested_timestamp={{ unique_ts }}'">
              <a href="?fp_view=true&timestamp_td={{ unique_ts }}&requested_timestamp={{ unique_ts }}">{{ unique_ts }}</a>
      {% else %}
            <td>{{ hdates }}</td>
            <td> {{ unique_ts }} </td>
        {% if requested_timestamp == False %}
            <td onclick="window.location='?fp_view=true&timestamp_td={{ unique_ts }}&requested_timestamp={{ unique_ts }}'">
              <a href="?fp_view=true&timestamp_td={{ unique_ts }}&requested_timestamp={{ unique_ts }}">{{ unique_ts }}</a>
        {% else %}
            <td onclick="window.location='?fp_view=true&timestamp_td={{ unique_ts }}&requested_timestamp={{ requested_timestamp }}'">
              <a href="?fp_view=true&timestamp_td={{ unique_ts }}&requested_timestamp={{ requested_timestamp }}">{{ unique_ts }}</a>
        {% endif %}
      {% endif %}
            </td>
          </tr>
    {% endfor %}
  			</tbody>
  		</table>
  {% endif %}
	  </div>
{% endif %}


{% if metric_td_dirs %}
  {% if list_by == 'metric_td_dirs' %}
<!-- BEGIN /ionosphere list_by 'metric_td_dirs' block -->
    {% if print_debug == 'True' %}
<code> DEBUG </code> :: /ionosphere list_by 'metric_td_dirs' block</br>
    {% endif %}

  <div class="tab-pane active" id="by_date">

      {% if print_debug == 'True' %}
        {% for unique_ts,hdates in metric_td_dirs %}
  <code> DEBUG </code> :: unique_ts :: {{ unique_ts }}</br>
  <code> requested_timestamp</code> :: {{ requested_timestamp }}<br>
  <code> hdates</code>:: {{ hdates }}</br>
  <code> unique_ts</code>:: {{ unique_ts }}</br>
        {% endfor %}
      {% endif %}
    <h4><span class="logo"><span class="sky">Features ::</span> <span class="re">profiles :: </span></span>{{ for_metric }} :: {{ td_files|length }} data sets</h4>
If you arrived here via an initial List by date route, your selected date is the <code>highlighted</code> entry
below.<br>
Please note: be advised that tracking the timestamp and metric through Flask
and Jinja templating was <b>very hard to achieve</b>.  However it was done to help <b>you</b>
as if there are multiple data sets below and you came here by a list by
date route, it is highly probable that you would not know the date you selected
once you were presented with a multiple choice.  Please take the appropriate
amount of time to appreciate this seemingly, insignificant feature that was
<b>painstakingly</b> added for your benefit.<br>
Also note:
  	<table class="table table-hover">
  		<thead>
  			<tr>
          <th>Date</th>
          <th>Timestamp</th>
          <th>Link to features profile data sets</th>
  			</tr>
  		</thead>
  		<tbody>
      {% for unique_ts,hdates in metric_td_dirs %}
        <tr>
        {% if (unique_ts|string == requested_timestamp) %}
          <td><code> {{ hdates }} </code></td>
        {% else %}
          <td> {{ hdates }} </td>
        {% endif %}
          <td> {{ unique_ts }} </td>
          <td onclick="window.location='?fp_view=true&timestamp={{ unique_ts }}&metric={{ for_metric }}&requested_timestamp={{ unique_ts }}'">
            <a href="?fp_view=true&timestamp={{ unique_ts }}&metric={{ for_metric }}&requested_timestamp={{ unique_ts }}">{{ unique_ts }}</a>
          </td>
        </tr>
      {% endfor %}
			</tbody>
		</table>
  </div>
  {% endif %}
	</div>
{% endif %}

<!-- # @added 20170118 - Feature #1862: Ionosphere features profiles search page -->
{% if fp_search %}


{% endif %}

{% if list_by %}
	</div>
	</div>
	</div>
  </div>
  </div>
{% endif %}

{% if metric_files %}
<!-- BEGIN /ionosphere 'metric_files' block -->
    {% if print_debug == 'True' %}
<code> DEBUG </code> :: /ionosphere?fp_view=true metric_files block</br>
    {% endif %}
<!-- # @added 20190328 - Feature #2484: FULL_DURATION feature profiles
     # Added ionosphere_echo -->
    {% if echo_fp == 1 %}
    <h4><span class="logo"><span class="sky">Features</span> <span class="re">profile: </span>{{ for_metric }} - {{ echo_human_date }}</h4>
    {% else %}
    <h4><span class="logo"><span class="sky">Features</span> <span class="re">profile: </span>{{ for_metric }} - {{ human_date }}</h4>
    {% endif %}

		<div class="col-md-10">
  {% if data_ok == False %}
  <h3><span class="logo"><span class="sky">Holy ::</span> <span class="re">shit</span></span></h3>
  <h4><span class="logo"><span class="sky">Skyline ::</span> <span class="re">error</span></span></h4>

  <b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">error message</span></span></b>
The timeseries data for this anomaly was not loaded, either an error occurred or
the data is gone or corrupt.  Please try reload the page <strong>quicker</strong>
next time.<br>
<b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">advice :: </span></span></b>
<ol type="1">
  <li>Try be quicker next time</li>
  <li>You can see if it is listed in the files section below and if it is
	not there then maybe some Gremlins are in the data centre or you might need to
	speak to management about the seemingly shoddy quality of the disks or resources
	that you administrator/s are providing for this very important service.
	</li>
	<li>This could be indicative of the IMMINENT failure of the server running
	this important Skyline service, it should not be corrupting or losing simple
	json text files, this is really unacceptable and you should consider writing
	a stern letter of complaint to your service provider.  If you are your own
	service provider, perhaps it is time you found a new service provider.</li>
</ol>
<b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">apologies ::</span></span></b> below in the Danger alert<br>
	  <div class="alert alert-danger">
<strong>Danger! Oh dear.</strong> <b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">apologies ::</span></span></b>
 profusely it seems that the timeseries json data for {{ for_metric }} at {{ timestamp }} | {{ human_date }}
has gone!!!  Perhaps it was removed before you could click the mouse. Maybe
you need to try and be quicker next time.
	  </div>
  {% endif %}

<!-- # @added 20170908 - Feature #2056: ionosphere - disabled_features_profiles -->
  {% if not profile_enabled %}
      <center><h3><span class="logo"><span class="re">THIS FEATURES PROFILE HAS BEEN DISABLED</span></span></h3></center>
  {% endif %}

  {% if parent_id == 0 %}
      <h3><span class="logo"><span class="sky">Trained ::</span> <span class="re">NOT anomalous ::</span></span> features profile id {{ features_profile_id }}</h3>
      <br>
      <center><h4><span class="logo"><span class="sky">This is a human operator generated features profile that was considered to be <span class="re">not anomalous</span></span></span></h4></center>
  {% else %}
      <h3><span class="logo"><span class="sky">Learnt ::</span> <span class="re">NOT anomalous ::</span></span> features profile id {{ features_profile_id }}</h3>
      <br>
<!-- # @added 20190328 - Feature #2484: FULL_DURATION feature profiles
     # Added ionosphere_echo -->
    {% if echo_fp == 1 %}
      <center><h4><span class="logo"><span class="sky">This is an <span class="re">ionosphere_echo </span>automatically generated features profile at <span class="re">FULL_DURATION</span> based on the validated </span></span>
      <a href="?fp_view=true&fp_id={{ parent_id }}&metric={{ for_metric }}" target="_blank"><b> Mirage parent features profile id {{ parent_id }}</b></a></h4></center>
    {% else %}
      <center><h4><span class="logo"><span class="sky">This is an ionosphere_learn <span class="re">automatically learnt and generated</span> features profile based on </span></span>
      <a href="?fp_view=true&fp_id={{ parent_id }}&metric={{ for_metric }}" target="_blank"><b>parent features profile id {{ parent_id }}</b></a></h4></center>
    {% endif %}
  {% endif %}
      <br>

<!-- # @added 20170917 - Feature #1996: Ionosphere - matches page -->
  {% if matched_fp_id %}
      <center><h4><span class="logo"><span class="sky">Evaluating MATCH ::</span> <span class="re">features profile ::</span> ionosphere_matched id - {{ matched_fp_id }}</span></h4></center>
<!-- # @added 20180620 - Feature #2404: Ionosphere - fluid approximation -->
    {% if minmax == 1 %}
    <center><h4><span class="logo"><span class="sky"></span> <span class="re">This is a Min-Max scaled match</span></span></h4></center>
    {% endif %}
<!-- # @added 20190328 - Feature #2484: FULL_DURATION feature profiles
     # Added ionosphere_echo -->
    {% if echo_fp == 1 %}
      <center><h4><span class="logo"><span class="sky">ionosphere echo ::</span> <span class="re">MATCHED AT {{ redis_full_duration_in_hours }} hours</span></span></h4></center>
    {% endif %}
      <br>
  {% endif %}

  {% if matched_layer_id %}
      <center><h4><span class="logo"><span class="sky">Evaluating MATCH ::</span> <span class="re">layers ::</span> ionosphere_layers_matched id - {{ matched_layer_id }}</span></h4></center>
<!-- # @added 20180921 - Feature #2558: Ionosphere - fluid approximation - approximately_close on layers -->
    {% if approx_close == 1 %}
      <center><h4><span class="logo"><span class="sky"></span> <span class="re">This is an approximately_close match</span></span></h4></center>
    {% endif %}
      <br>
  {% endif %}

  {% if matched_fp_id or matched_layer_id %}
    {% if match_validated_db_value == 0 %}
      <center><h4><span class="logo"><span class="sky">Match :: </span> <span class="re">not validated yet</span></span></h4></center>
    {% elif match_validated_db_value == 1 %}
      <center><h4><span class="logo"><span class="sky">Match :: </span> <span class="re">VALID</span></span></h4></center>
    {% else %}
      <center><h4><span class="logo"><span class="sky">Match :: </span> <span class="re">INVALID</span></span></h4></center>
    {% endif %}
  {% endif %}

  	  <h4><span class="logo"><span class="sky">Calculated ::</span> <span class="re">features ::</span></span> features profile id {{ features_profile_id }}</h4>
  {% if extracted_features %}
  		<pre>{{ extracted_features }}</pre>
  {% else %}
  		<pre>No extracted_features were passed, which is not ideal</pre>
  {% endif %}
  	  <h4><span class="logo"><span class="sky">Features ::</span> <span class="re">details ::</span></span> features profile id {{ features_profile_id }}</h4>
  {% if features_profile_details %}
  		<pre>{{ features_profile_details }}</pre>
  {% else %}
  		<pre>No features_profile_details were passed, which is not ideal</pre>
  {% endif %}

<!-- # @added 20190922 - Feature #2516: Add label to features profile -->
  	  <h4><span class="logo"><span class="sky">Features ::</span> <span class="re">label ::</span></span> features profile id {{ features_profile_id }}</h4>
  {% if fp_label %}
  		<pre>{{ fp_label }}</pre>
  {% else %}
  		<pre>None</pre>
  {% endif %}

<!-- # @added 20170402 - Feature #2000: Ionosphere - validated -->
  {% if validated %}
  	  <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">validated ::</span></span> True</h4>

    {% if validated_fp_successful %}
  	  <div class="alert alert-success">
  	    <strong>Success!</strong> The features profile has now been validated<br>
  	  </div>
    {% endif %}
  {% else %}
  	  <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">validated ::</span></span>< False</h4>
	  <div class="alert alert-warning">
    <strong>Warning!</strong> This features profile has not been validated, please review it against
<a href="?fp_view=true&fp_id={{ parent_id }}&metric={{ for_metric }}" target="_blank"><b>parent features profile id {{ parent_id }}</b></a>
and validate that it is valid.
      <a href="?fp_view=true&timestamp={{ timestamp }}&metric={{ for_metric }}&validate_fp=true">
      <button type="button">Validate features profile</button></a>
	  </div>
  {% endif %}

<!-- # @added 20171106 - Feature #2210: existing features profiles link
Add a link to features profiles for a metric so that the operator can open up
the features profile search page with all the features profiles for the metric
to evaluate efficiency and count of features profiles to determine how effectively
Ionosphere is working on a metric.  This could be a table insert like Existing
layers, but big tables may hinder easy navigation in the training page, so a
link and new tab is ok.
-->
	  <h4><span class="logo"><span class="sky">Existing ::</span> <span class="re">features profiles page link ::</span></span> <a href="?fp_search=true&metric={{ for_metric}}&limit=0&order=DESC" target="_blank">existing features profile page for {{ for_metric }}</a></h4>
<!-- # @added 20180918 - Feature #2602: Graphs in search_features_profiles -->
	  <h4><span class="logo"><span class="sky">Existing ::</span> <span class="re">features profiles page link with graphs ::</span></span> <a href="?fp_search=true&metric={{ for_metric}}&limit=0&order=DESC&show_graphs=true" target="_blank">existing features profile page with graphs for {{ for_metric }}</a></h4>

  	  <h4><span class="logo"><span class="sky">Layers ::</span> <span class="re">details ::</span></span> features profile ionosphere_layers id {{ layer_id }}</h4>
  {% if layer_details %}
  		<pre>{{ layer_details }}</pre>
  {% else %}
  		<pre>There are no Ionosphere layers for this features profile</pre>
  {% endif %}
  {% if layer_algorithms_details %}
  	  <h4><span class="logo"><span class="sky">Layers ::</span> <span class="re">algorithms ::</span></span> features profile ionosphere_layers id {{ layer_id }}</h4>
  		<pre>{{ layer_algorithms_details }}</pre>
<!-- @added 20170327 - Feature #2004: Ionosphere layers - edit_layers
#                      Task #2002: Review and correct incorrectly defined layers
layer_algorithms_details_object metric_layers_algorithm_details existing_algorithms
-->

    {% if layers_updated %}
  	  <div class="alert alert-success">
  	    <strong>Success!</strong> The features profile layers were updated - {{ layers_updated }}<br>
  	  </div>
    {% endif %}
      <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#edit_layers">Edit layers</button>
      <code>WARNING - this should only be used to correct an incorrectly defined layer, it should not be used to shuffle and change values to match the range better.
This affects LEARNING.  If you want to extend Skyline's description of the "Active Brownian Motion" then make a new layer.</code>

  		<div class="col-md-12">
        <div id="edit_layers" class="collapse">
          <form action="ionosphere">
    		  <table class="table table-hover">
    		    <thead>
    		      <tr>
    		        <th>Layer</th>
    		        <th>Criteria</th>
    		      </tr>
    		    </thead>
    		    <tbody>
    		      <tr>
    		        <td>D layer <code>[required]</code></td>
    		        <td>if value <select name="d_condition">
                  <option value="{{ profile_layer_algorithms[0][6] }}">{{ profile_layer_algorithms[0][6] }}</option>
                {% for item in value_condition_list %}
                      <option value="{{ item }}">{{ item }}</option>
                {% endfor %}
      		        <input type="text" name="d_boundary_limit" value="{{ profile_layer_algorithms[0][7] }}" /> in the last
      		        <input type="text" name="d_boundary_times" value="{{ profile_layer_algorithms[0][8] }}"> values in the timeseries - <code>DISCARD - not_anomalous</code> False<br>
                The D layer can be used as the upper limit, if value > x (probably or certainly anomalous)<br>
                Or this can be used if this metric operates in the negative range or<br>
                if you want it too not discard on 0 as you want to match 0, set it to -1 or > 0.1 or > 1<br>
                On a high constant rate metric the D layer can be used to discard if < x so the the layer <b>does not silence a drop</b><br>
                This layer can be complimented by the optional D1 layer below<br>
                <code>Remember a match here disables any of the other below layers being checked</code><br>
                </td>
    		      </tr>
              <!-- @added 20170616 - Feature #2048: D1 ionosphere layer
              Handle backwards compatible for layers that have not D1 layer defined -->
    		      <tr>
    		        <td>D1 layer <code>[optional]</code></td>
    		        <td>if value <select name="d1_condition">
    {% if profile_layer_algorithms[2] %}
                  <option value="{{ profile_layer_algorithms[2][6] }}">{{ profile_layer_algorithms[2][6] }}</option>
    {% else %}
                  <option value="none">none</option>
    {% endif %}
                {% for item in value_condition_list %}
                      <option value="{{ item }}">{{ item }}</option>
                {% endfor %}
    {% if profile_layer_algorithms[2] %}
      		        <input type="text" name="d1_boundary_limit" value="{{ profile_layer_algorithms[2][7] }}" /> in the last
                  <input type="number" name="d1_boundary_times" value="{{ profile_layer_algorithms[2][8] }}" /> values in the timeseries - <code>DISCARD - not_anomalous</code> False<br>
    {% else %}
      		        <input type="text" name="d1_boundary_limit" value="0" /> in the last
                  <input type="number" name="d1_boundary_times" value="0" /> values in the timeseries - <code>DISCARD - not_anomalous</code> False<br>
    {% endif %}
                The D1 layer can be used as an upper or lower limit, so the D layer <b>does not silence a drop</b><br>
                <code>Remember a match here disables any of the other below layer conditions from being checked</code><br>
                </td>
    		      </tr>
    		      <tr>
    		        <td>E layer <code>[required]</code></td>
    		        <td>if value <select name="e_condition">
                  <option value="{{ profile_layer_algorithms[1][6] }}">{{ profile_layer_algorithms[1][6] }}</option>
                {% for item in value_condition_list %}
                      <option value="{{ item }}">{{ item }}</option>
                {% endfor %}
      		        <input type="text" name="e_boundary_limit" value="{{ profile_layer_algorithms[1][7] }}" /> in the last
                <input type="number" name="e_boundary_times" value="{{ profile_layer_algorithms[1][8] }}" /> values in the timeseries - <code>not anomalous</code>
                </select></td>
    		      </tr>
    		      <tr>
    		        <td>Es layer <code>[optional]</code><br>
                This layer allows to match a day in a list<br>
                <code>NOT IMPLEMENTED YET</code>
                </td>
    		        <td>Enabled: <select name="es_layer">
                  <option value="false">false</option>
                  <option value="true">true</option>
                  </select>
    		          if day in <input type="text" name="es_day" value="['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']" /> - <code>not anomalous</code><br>
                  A Python list - example <code>['tue']</code> or <code>['sat', 'sun']</code>
                </td>
    		      </tr>
    		      <tr>
    		        <td>F1 layer <code>[optional]</code><br>
                  This layer and the F2 layer<br>
                  allow for excluding a time period<br>
                  <code>NOT IMPLEMENTED YET</code>
                </td>
    		        <td>Enabled: <select name="f1_layer">
                  <option value="false">false</option>
                  <option value="true">true</option>
                  </select>
                  if from_time > <input type="text" name="f1_from_time" value="0000" /> (format HHMM) - <code>not anomalous</code>
                </td>
    		      </tr>
    		      <tr>
    		        <td>F2 layer <code>[optional]</code><br>
                <code>NOT IMPLEMENTED YET</code></td>
    		        <td>Enabled: <select name="f1_layer">
                  <option value="false">false</option>
                  <option value="true">true</option>
                  </select>
                  if until_time < <input type="text" name="f2_until_time" value="2359" /> (format HHMM) - <code>not anomalous</code>
                </td>
    		      </tr>
    		      <tr>
    		        <td>Edit layers</td>
    		        <td><select name="fp_layer">
                  <option value="true">true</option>
                  </select>
                  for fp_id <select name="fp_id"><option value="{{ features_profile_id }}">{{ features_profile_id }}</option></select><br>
    			        Label: <input type="text" name="fp_layer_label" value="{{ current_layer[0][5] }}" /> - optional label, e.g. tuesday_pentest
    			        <input type="hidden" name="edit_fp_layers" value="true" />
    			        <input type="hidden" name="layers_id" value="{{ layer_id }}" />
    			        <input type="hidden" name="fp_view" value="true" />
    			        <input type="hidden" name="timestamp" value="{{ timestamp }}" />
    			        <input type="hidden" name="metric" value="{{ for_metric }}" />
                  <input type="submit" value="Edit Ionosphere layers">
                  </form>
                </td>
    		      </tr>
    		    </tbody>
    		  </table>
        </div>
      </div>
  {% endif %}

<!-- # @added 20170917 - Feature #1996: Ionosphere - matches page -->
  {% if matched_fp_id %}
<!-- # @modified 20180620 - Feature #2404: Ionosphere - fluid approximation -->
    {% if minmax == 0 %}
    <h4><span class="logo"><span class="sky">MATCHED evaluating ::</span> <span class="re">ionosphere_matched id ::</span></span> {{ matched_fp_id }}</h4>
    {% else %}
    <h4><span class="logo"><span class="sky">MATCHED evaluating ::</span> <span class="re">ionosphere_matched id ::</span></span> {{ matched_fp_id }}</h4>
    <center><h4><span class="logo"><span class="sky"></span> <span class="re">This match was made using Min-Max scaling of the features profile time series and the anomalous timeseries</span></span></h4></center>
    {% endif %}
		<pre>{{ matched_id_resources }}</pre>
    {% if matched_graph_image_file %}
    <img src="ionosphere_images?image={{ matched_graph_image_file }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
    {% endif %}
    <br>

<!-- # @added 20190601 - Feature #3084: Ionosphere - validated matches -->
    {% if match_validated_db_value == 0 %}
  	  <h4><span class="logo"><span class="sky">Match ::</span> <span class="re">not validated</span></span></h4>
	   <div class="alert alert-warning">
      This match has not been validated, please review it and validate or invalidate it
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_fp_id={{ matched_fp_id }}&match_validation=1">
      <button type="button">Validate match</button></a>
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_fp_id={{ matched_fp_id }}&match_validation=2">
      <button type="button">Invalidate match</button></a>
	   </div>
    {% elif match_validated_db_value == 1 %}
  	  <h4><span class="logo"><span class="sky">Match :: </span> <span class="re">validated ::</span></span> <code>True</code></h4>
	   <div class="alert alert-warning">
      If this match was incorrectly validated, you can invalidate it
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_fp_id={{ matched_fp_id }}&match_validation=2">
      <button type="button">Invalidate match</button></a>
	   </div>
    {% else %}
  	  <h4><span class="logo"><span class="sky">Match :: </span> <span class="re">INVALID ::</span></span> True</h4>
	   <div class="alert alert-warning">
      If this match was incorrectly invalidated, you can validate it
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_fp_id={{ matched_fp_id }}&match_validation=1">
      <button type="button">Validate match</button></a>
	   </div>
    {% endif %}
  {% endif %}

  {% if matched_layer_id %}
    <h4><span class="logo"><span class="sky">MATCHED evaluating ::</span> <span class="re">ionosphere_layers_matched id ::</span></span> {{ matched_layer_id }}</h4>
		<pre>{{ matched_id_resources }}</pre>
    {% if matched_graph_image_file %}
    <img src="ionosphere_images?image={{ matched_graph_image_file }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
    {% endif %}

<!-- # @added 20190601 - Feature #3084: Ionosphere - validated matches -->
    {% if match_validated_db_value == 0 %}
  	  <h4><span class="logo"><span class="sky">Match ::</span> <span class="re">not validated</span></span></h4>
	   <div class="alert alert-warning">
      This match has not been validated, please review it and validate or invalidate it
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_layer_id={{ matched_layer_id }}&match_validation=1">
      <button type="button">Validate match</button></a>
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_layer_id={{ matched_layer_id }}&match_validation=2">
      <button type="button">Invalidate match</button></a>
	   </div>
    {% elif match_validated_db_value == 1 %}
  	  <h4><span class="logo"><span class="sky">Match :: </span> <span class="re">validated ::</span></span> <code>True</code></h4>
	   <div class="alert alert-warning">
      If this match was incorrectly validated, you can invalidate it
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_layer_id={{ matched_layer_id }}&match_validation=2">
      <button type="button">Invalidate match</button></a>
	   </div>
    {% else %}
  	  <h4><span class="logo"><span class="sky">Match :: </span> <span class="re">INVALID ::</span></span> True</h4>
	   <div class="alert alert-warning">
      If this match was incorrectly invalidated, you can validate it
      <a href="?fp_view=true&fp_id={{ features_profile_id }}&metric={{ for_metric }}&timestamp={{ timestamp }}&matched_layer_id={{ matched_layer_id }}&match_validation=1">
      <button type="button">Validate match</button></a>
	   </div>
    {% endif %}

    <br>
  {% endif %}

  {% if validated_match_successful %}
	  <div class="alert alert-success">
	    <strong>Success!</strong> The match has now been validated<br>
	  </div>
  {% endif %}

<!-- # @added 20170908 - Feature #2056: ionosphere - disabled_features_profiles -->
  {% if family_tree_ids %}
    {% if family_tree_ids|length > 1 %}
	  <h4><span class="logo"><span class="sky">Progeny features profiles ::</span> <span class="re">count :: </span></span>{{ family_tree_ids|length - 1 }} learnt profiles</h4>
      {% for item in family_tree_ids %}
        {% if item != features_profile_id %}
      <a href="?fp_view=true&fp_id={{ item }}&metric={{ for_metric }}" target="_blank"><b>{{ item }}</b></a>
        {% endif %}
      {% endfor %}
    {% else %}
	  <h4><span class="logo"><span class="sky">Progeny features profiles ::</span> <span class="re">count :: </span></span>0 learnt profiles</h4>
    {% endif %}
  {% else %}
	  <h4><span class="logo"><span class="sky">Progeny features profiles ::</span> <span class="re">count :: </span></span>0 learnt profiles</h4>
  {% endif %}

      <h4><span class="logo"><span class="sky">Anomaly ::</span> <span class="re">details ::</span></span> {{ for_metric }} with metrics id {{ metric_id }}</h4>
      {{ metric_vars }}<br>
  {% if panorama_anomaly_id != False %}
      <h4><span class="logo"><span class="sky">Panorama ::</span> <span class="re">anomaly ::</span></span> id {{ panorama_anomaly_id }}</h4>
  {% elif panorama_anomaly_id == 'None' %}
    {% if parent_id == 0 %}
      <h4><span class="logo"><span class="sky">Panorama ::</span> <span class="re">anomaly ::</span></span> id {{ panorama_anomaly_id }}</h4>
{{ for_metric }} has no Panorama anomaly recorded at this timestamp, this can
happen see <b><span class="logo"><span class="sky">Known</span> <span class="re">bugs</span></span></b> below
    {% else %}
      <h4><span class="logo"><span class="sky">Panorama ::</span> <span class="re">anomaly ::</span></span> none expected for an ionosphere_learn features profile</h4>
    {% endif %}
  {% else %}
      <h4><span class="logo"><span class="sky">Panorama ::</span> <span class="re">anomaly ::</span></span> id {{ panorama_anomaly_id }}</h4>
  {% endif %}
  {% if panorama_anomaly_id == None %}
    {% if parent_id == 0 %}
	  <div class="alert alert-warning">
<strong>Warning!</strong> <b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">apologies ::</span></span></b>
 profusely it seems that {{ for_metric }} has no Panorama anomaly recorded at
this timestamp, this can happen
see <b><span class="logo"><span class="sky">Known</span> <span class="re">bugs</span></span></b> at
the top right of this page.  Here is hoping that this day just gets better.
	  </div>
    {% else %}
	  <div class="alert alert-success">
	    <strong>OK :: </strong> no Panorama anomaly id is expected for
      an <b><span class="logo"><span class="re">automatically learnt and generated</span> <span class="sky">ionosphere_learn</span></span></b> features profile
	  </div>
    {% endif %}
  {% endif %}

<!-- # @modified 20190331 - Feature #2484: FULL_DURATION feature profiles
     # Use 24 hours Graphite graph for Ionosphere echo and red border
-->
  {% if echo_fp == 1 %}
      <h4><span class="logo"><span class="sky">Redis ::</span> <span class="re">not_anomalous ::</span></span> graph that this <span class="logo"><span class="sky">ionosphere_echo</span></span> features profile is based on</h4>
    {% for image in metric_images %}
      {% if '.redis.plot' in image %}
      <center><div class="overlay-graph">
       <img class="image" src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" style="border:5px solid red" />
       <div class="text"><span class="logo"><span class="re">Matched this 24 hour time series from</span></span> {{ echo_human_date }}</div>
      </div></center><br>
      {% endif %}
    {% endfor %}

    {% if matched_fp_id %}
      {% for image in metric_images %}
        {% if '.matplotlib' in image %}
      <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">time series ::</span></span> database data plot</h4>
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} features profile timeseries graph" class="img-responsive center-block" /><br>
Image file: {{ image }}<br><br>
        {% endif %}
      {% endfor %}
    {% endif %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">not_anomalous ::</span></span> graph that this <span class="logo"><span class="sky">ionosphere_echo</span></span> features profile is based on</h4>
  {% else %}
    {% for image in metric_images %}
<!-- # @modified 20210323 - Feature #3642: Anomaly type classification -->
      {% if ((not '.redis.plot' in image) and (not '.matplotlib' in image) and (not 'luminosity.classify_anomaly' in image)) %}
        {% if metric_second_order_resolution_hours != False %}
          {% if parent_id == 0 %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">anomaly ::</span></span> graph at <strong>{{ metric_second_order_resolution_hours }} hours</strong></h4>
          {% else %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">anomaly ::</span></span> parent features profile graph that this ionosphere_learn is based on</h4>
          {% endif %}
        {% else %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">anomaly ::</span></span> graph at <strong>{{ metric_full_duration_in_hours }} hours</strong></h4>
        {% endif %}
        {% if graphite_url != False %}
If you wish to see the <a target='_blank' href="{{ graphite_url }}">current
Graphite graph</a> for {{ for_metric }} (opens in new tab)
        {% endif %}
<!--      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
-->
        {% if matched_fp_id %}
      <center><div class="overlay-graph">
       <img class="image" src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" style="border:5px solid red" />
       <div class="text"><span class="logo"><span class="re">Matched this time series from</span></span> <strong>{{ echo_human_date }}</strong></div>
      </div></center><br>
        {% else %}
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
        {% endif %}
Image file: {{ image }}<br><br>
      {% endif %}
    {% endfor %}

    {% if matched_fp_id %}
      {% for image in metric_images %}
        {% if '.matplotlib' in image %}
      <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">time series ::</span></span> data from the database that the features profile was created with</h4>
This is the <strong>exact</strong> data which the features profile was created with.<br>
It is plotted here to ensure that all detail can be seen that has been lost in
the Graphite graph above due the image <strong>render summarization based on the
available pixels</strong> (e.g. width).<br>
Please also refer to <strong>this data</strong> for validation as the Graphite
graph may flatten the data.
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} features profile time series graph" class="img-responsive center-block" /><br>
Image file: {{ image }}<br><br>
        {% endif %}
      {% endfor %}
    {% else %}
      {% for image in metric_images %}
        {% if '.matplotlib' in image %}
      <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">time series ::</span></span> data from the database that the features profile was created with</h4>
This is the <strong>exact</strong> data which the features profile was created with.<br>
It is plotted here to ensure that all detail can be seen that has been lost in
the Graphite graph above due the image <strong>render summarization based on the
available pixels</strong> (e.g. width).<br>
Please also refer to <strong>this data</strong> for validation as the Graphite
graph may flatten the data.
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} features profile time series graph" class="img-responsive center-block" /><br>
Image file: {{ image }}<br><br>
        {% endif %}
      {% endfor %}
    {% endif %}

  {% endif %}

  {% if parent_id == 0 %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">graphs WHEN created ::</span></span> at <strong>7h, 24h, 7d and 30d</strong> for anomaly at <strong>{{ human_date }}</strong></h4>
  {% else %}
<!-- # @added 20190328 - Feature #2484: FULL_DURATION feature profiles
     # Added ionosphere_echo -->
    {% if echo_fp == 1 %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">graphs WHEN created ::</span></span> at <strong>7h, 24h, 7d and 30d</strong> for anomaly at <strong>{{ echo_human_date }} - these graphs may be aggregated due the the echo features profile being made at a later date than the parent</strong></h4>
	  <div class="alert alert-warning">
    The <b><span class="logo"><span class="sky">ionosphere_echo ::</span> <span class="re">features profile ::</span></span></b> was created based on the <b>Graphite NOW graph at {{ redis_full_duration_in_hours }} hours</b> graph below
	  </div>
    {% else %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">graphs WHEN created ::</span></span> at <strong>7h, 24h, 7d and 30d</strong> for anomaly at <strong>{{ human_date }}</strong></h4>
	  <div class="alert alert-warning">
    The <b><span class="logo"><span class="sky">ionosphere_learn ::</span> <span class="re">features profile ::</span></span></b> was created based on the <b>Graphite NOW at {{ metric_second_order_resolution_hours // 24 }} days</b> graph below
	  </div>
    {% endif %}
  {% endif %}
<!-- @added 20170116 - Feature #1854: Ionosphere learn - generations
                       Feature #1842: Ionosphere - Graphite now graphs -->
  {% for gimage in graphite_now_images %}
<!--      <img src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" />
# Align 4 images - tried all of http://stackoverflow.com/questions/9382970/how-to-center-a-div-with-bootstrap2
# end up using https://owlcation.com/stem/how-to-align-images-side-by-side thanks
# Ellen Brundige
-->
<!-- # @added 20190330 - Feature #2484: FULL_DURATION feature profiles
     # ionosphere echo matched red border
-->
    {% if echo_fp == 1 %}
      {% if '.24h.png' in gimage %}
        <img src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em; border:5px solid red">
      {% else %}
        <img src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em;">
      {% endif %}
    {% else %}
        {% if metric_full_duration_in_hours_image_str in gimage %}
        <div class="overlay-mirage">
<!--          <img class="image" src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em; border:5px solid red" /> -->
          <img class="overlay-mirage-image" src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="border:5px solid red" />
<!--         <img src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em; border:5px solid red" />
          <div class="overlay-mirage-matched_text">Matched</div> -->
        </div>
<!--        <img src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em; border:5px solid red"> -->
        {% else %}
        <img src="ionosphere_images?image={{ gimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em;">
        {% endif %}
    {% endif %}
  {% endfor %}
        <p style="clear: both;">

<!-- # @added 20170908 - Feature #2056: ionosphere - disabled_features_profiles -->
  {% if profile_enabled %}
  	  <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">enabled ::</span></span> True</h4>
	  <div class="alert alert-danger">
    If this features profile was created or learnt incorrectly it can be disabled.  <strong>Note</strong>
    all the learnt progeny features profiles listed below (if there are any) will be disabled as well.
      <a href="?fp_view=true&timestamp={{ timestamp }}&metric={{ for_metric }}&disable_fp={{ features_profile_id }}">
      <button type="button" onclick="return confirm('Are you sure you want to disable the features profile and all related progeny features profiles? Disable {{ family_tree_ids|length }} features profiles?');"><b>Disable features profile</b></button></a>
	  </div>
  {% else %}
  	  <h4><span class="logo"><span class="sky">Features profile ::</span> <span class="re">enabled ::</span></span> False</h4>
    {% if disabled_fp_successful %}
  	  <div class="alert alert-success">
  	    <strong>Success!</strong> The {{ family_tree_ids|length }} features profiles have now been disabled<br>
  	  </div>
    {% endif %}
	  <div class="alert alert-danger">
      <strong>This features profiles has been disabled</strong>
	  </div>
  {% endif %}

<!-- # @added 20170908 - Feature #2056: ionosphere - disabled_features_profiles -->
  {% if family_tree_ids %}
    {% if family_tree_ids|length > 1 %}
	  <h4><span class="logo"><span class="sky">Progeny features profiles ::</span> <span class="re">count :: </span></span>{{ family_tree_ids|length - 1 }} learnt profiles</h4>
      {% for item in family_tree_ids %}
        {% if item != features_profile_id %}
      <a href="?fp_view=true&fp_id={{ item }}&metric={{ for_metric }}"><b>{{ item }}</b></a>
        {% endif %}
      {% endfor %}
    {% else %}
	  <h4><span class="logo"><span class="sky">Progeny features profiles ::</span> <span class="re">count :: </span></span>0 learnt profiles</h4>
    {% endif %}
  {% else %}
	  <h4><span class="logo"><span class="sky">Progeny features profiles ::</span> <span class="re">count :: </span></span>0 learnt profiles</h4>
  {% endif %}

<!-- # @modified 20190601 - Feature #3084: Ionosphere - validated matches
# Wrapped up in if matched_layer_id present layers matches first -->
  {% if matched_layer_id %}
<!-- # @added 20170308 - Feature #1960: ionosphere_layers
# To present the operator with the matched layers Graphite graphs -->
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">layers MATCHED ::</span></span> the last {{graphite_layers_matched_images|length}} not anomalous graphs of the {{ metric_layers_matched_count }} matches that this profile's layers have had</h4>
      Only one graph is displayed per 10 minute period, a layer could match mulitple times in 10 minutes, but only one graph per 10 minute period is displayed
    {% for gmimage in graphite_layers_matched_images %}
        <img src="ionosphere_images?image={{ gmimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em;">
    {% endfor %}
        <p style="clear: both;">

      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">profile MATCHED ::</span></span> the last {{graphite_matched_images|length}} not anomalous graphs of the {{ matched_count }} matches that this profile has had</h4>
      Only one graph is displayed per 10 minute period, a profile could match mulitple times in 10 minutes, but only one graph per 10 minute period is displayed
    {% for gmimage in graphite_matched_images %}
        <img src="ionosphere_images?image={{ gmimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em;">
    {% endfor %}
        <p style="clear: both;">
  {% else %}
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">profile MATCHED ::</span></span> the last {{graphite_matched_images|length}} not anomalous graphs of the {{ matched_count }} matches that this profile has had</h4>
      Only one graph is displayed per 10 minute period, a profile could match mulitple times in 10 minutes, but only one graph per 10 minute period is displayed
    {% for gmimage in graphite_matched_images %}
        <img src="ionosphere_images?image={{ gmimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em;">
    {% endfor %}
        <p style="clear: both;">

<!-- # @added 20170308 - Feature #1960: ionosphere_layers
# To present the operator with the matched layers Graphite graphs -->
      <h4><span class="logo"><span class="sky">Graphite ::</span> <span class="re">layers MATCHED ::</span></span> the last {{graphite_layers_matched_images|length}} not anomalous graphs of the {{ metric_layers_matched_count }} matches that this profile's layers have had</h4>
      Only one graph is displayed per 10 minute period, a layer could match mulitple times in 10 minutes, but only one graph per 10 minute period is displayed
    {% for gmimage in graphite_layers_matched_images %}
        <img src="ionosphere_images?image={{ gmimage }}" alt="{{ for_metric }} timeseries graph" style="float: left; width: 40%; margin-right: 1%; margin-bottom: 0.5em;">
    {% endfor %}
        <p style="clear: both;">
  {% endif %}

  {% for image in metric_images %}
    {% if '.redis.plot' in image %}
      <h4><span class="logo"><span class="sky">Redis ::</span> <span class="re">anomaly ::</span></span> data plot at <strong>{{ redis_full_duration_in_hours }} hours</strong></h4>
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
Image file: {{ image }}<br><br>
    {% endif %}
  {% endfor %}

<!-- # @added 20180414 - Branch #2270: luminosity -->
  {% if panorama_anomaly_id %}
    {% include "correlations.html" %}
  {% endif %}

<!-- # @added 20210323 - Feature #3642: Anomaly type classification -->
  {% if 'luminosity.classify_anomaly' in metric_images_str %}
    {% if metric_second_order_resolution_hours != False %}
  <h4><span class="logo"><span class="sky">Luminosity ::</span> <span class="re">classify_anomaly ::</span></span> graphs at <strong>{{ metric_second_order_resolution_hours }} hours</strong></h4>
    {% else %}
  <h4><span class="logo"><span class="sky">Luminosity ::</span> <span class="re">classify_anomaly ::</span> graphs at <strong>{{ metric_full_duration_in_hours }} hours</strong></h4>
    {% endif %}
    {% for image in metric_images %}
      {% if 'luminosity.classify_anomaly' in image %}
      <img src="ionosphere_images?image={{ image }}" alt="{{ for_metric }} timeseries graph" class="img-responsive center-block" /><br>
Image file: {{ image }}<br><br>
      {% endif %}
    {% endfor %}
  {% endif %}

      <h4><span class="logo"><span class="sky">Features ::</span> <span class="re"> profile ::</span></span> files</h4>
      <table>
        <tr>
          <th>[filename, path_and_filename]</th>
        </tr>
  {% for file in metric_files %}
        <tr>
          <td> {{ file }} </td>
          <td onclick="window.location='?metric_td={{ metric }}'">
            <a href="?metric_td={{ metric }}">{{ metric }}</a>
          </td>
        </tr>
  {% endfor %}
      </table>

  {% if data_ok == True %}
      <br><p>
<!-- # @modified 20170309 - Feature #1960: ionosphere_layers
      <h4><span class="logo"><span class="sky">Timeseries ::</span> <span class="re">not anomalous ::</span></span></span> <span class="sky">available</span></h4>-->
<!-- # @modified 20190922 - Feature #2516: Add label to features profile
# Only display the last 30 data points
      <h4><span class="logo"><span class="sky">Time series ::</span> <span class="re">anomalous ::</span></span></span> <span class="sky">json available [['app', '{{ app_context }}'], ['full_duration', {{ ts_full_duration }}]]</span></h4>
      {{ last_ts_json }}
 -->
<!-- # @modified 20200711 - Feature #3634: webapp - ionosphere - report number of data points
     # Added length -->
      <h4><span class="logo"><span class="sky">Time series ::</span> <span class="re">anomalous ::</span></span> <span class="sky">json available [['app', '{{ app_context }}'], ['full_duration', {{ ts_full_duration }}]] - last 30 data points of {{ anomalous_timeseries_length }}</span></h4>
      {{ last_ts_json[-30:] }}
<!-- # @added 20170309 - Feature #1960: ionosphere_layers
Also return the Analyzer FULL_DURATION timeseries if available in a Mirage
based features profile -->
    {% if ionosphere_json %}
<!-- # @modified 20190922 - Feature #2516: Add label to features profile
# Only display the last 30 data points
      <h4><span class="logo"><span class="sky">Timeseries ::</span> <span class="re">anomalous ::</span></span></span> <span class="sky">json available [['app', 'Analyzer'], ['full_duration', {{ baseline_fd }}]]</span></h4>
      {{ last_i_ts_json }}
-->
<!-- # @modified 20200711 - Feature #3634: webapp - ionosphere - report number of data points
     # Added length -->
      <h4><span class="logo"><span class="sky">Timeseries ::</span> <span class="re">anomalous ::</span></span> <span class="sky">json available [['app', 'Analyzer'], ['full_duration', {{ baseline_fd }}]] - last 30 data points of {{ ts_json_length }}</span></h4>
      {{ last_i_ts_json[-30:] }}
    {% endif %}
  {% endif %}
  </div>
  <div class="known_bugs">
    <table>
        <caption><b><span class="logo"><span class="sky">Known</span> <span class="re">bugs</span></span></b></caption>
        <tr>
<!-- @modified 20170106 - Feature #1830: Ionosphere alerts
#                         Bug #1460: panorama check file fails
#                         Panorama check file fails #24
# Fixed
          <td>
            <a target='_blank' href="https://github.com/earthgecko/skyline/issues/24">#24</a>
          </td>
          <td>An anomaly can sometimes not have a matching Panorama anomaly record due to Panorama check file fails #24</td>
-->
          <td>None</td>
          <td>That are known of at the present time</td>
        </tr>
    </table>
  </div>
{% endif %}

<!-- END /ionosphere/fp_veiw=true block -->
{% endblock %}
